#ifndef MYGRAPH_H_INCLUDED
#define MYGRAPH_H_INCLUDED

#include<iostream>
#include<cstring>
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<queue>
#include<algorithm>
using namespace std;

class EdgeNode
{ 
friend class MyGraph;
private:
    int dest;      
    EdgeNode *link; 
public:
    EdgeNode();
    EdgeNode(int, EdgeNode *);
    ~EdgeNode();
    int getDest();
    EdgeNode *getNext();
    void setDest(int);
    void setNext(EdgeNode *);
};

class VertexNode
{ 
    friend class EdgeNode;
    friend class MyGraph;
private:
    char data;          
    EdgeNode *firstEdge; 
public:
    VertexNode();
    VertexNode(char, EdgeNode *);
    ~VertexNode();
    char getData();
    EdgeNode *getFirstEdge();
    void setData(char);
    void setFirstEdge(EdgeNode *);
};

class MyGraph
{ 
private:
    int nodeNum;         
    int edgeNum;         
    VertexNode *VexList; 
    friend class VertexNode;
    friend class EdgeNode;

public:
    MyGraph();
    MyGraph(int, int, char *, int *, int *);
    ~MyGraph();
    int getNodeNum();
    int getEdgeNum();
    string printGraph(); 
    void DFS(int, bool *, string &);
    void BFS(int, bool *, string &);
    string graph_BFS_Traverse();
    string graph_DFS_Traverse();
};

#endif 
